#ifndef __LITE_TYPE_H__
#define __LITE_TYPE_H__

#include <stdint.h> 
#include <stdio.h>
#include <string.h>
#include <stdarg.h>  // 用于处理可变参数

typedef   uint8_t   u8;
typedef   uint16_t  u16;
typedef   uint32_t  u32;
typedef   int8_t    s8;
typedef   int16_t   s16;
typedef   int32_t   s32;

#define   DIFF(a,b) ((a)>(b)? (a-b):(b-a))
//#define   MBIT(a,b) (((a)&(b))? ON : OFF)
//#define   RBIT(a,b) (((a)&(b))? OFF : ON)
      
#define   ABS(a)    ((a)>0? (a):-(a))
#define   MIN(a,b)  ((a)>(b)? (b):(a))
#define   MAX(a,b)  ((a)>(b)? (a):(b))
      
#define   HI4BIT(a) ((BYTE)((a)>>4))
#define   LO4BIT(a) ((BYTE)((a)&0x0f))
      
#define   HIBYTE(a) ((BYTE)((a)>>8))
#define   LOBYTE(a) ((BYTE)((a)&0xff))
      
#define   HIWORD(a) ((WORD)((a)>>16))
#define   LOWORD(a) ((WORD)((a)&0xffff))

#define   MAKEBYTE(a,b)   ((BYTE)(((BYTE)(a)<<4)|(b)))
#define   MAKEWORD(a,b)   ((WORD)(((WORD)(a)<<8)|(b)))
#define   MAKEDWORD(a,b)  ((DWORD)(((DWORD)(a)<<16)|(b)))

#endif
/***************************** LiteBsp by Miaozi (END OF FILE) *********************************/
